package com.xx.sign.controller;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.xx.sign.vo.TestVo;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.io.IOException;

/**
 * @author fanjj
 * @date 2017/10/18
 */
@Controller
public class TestController {
    private final static ObjectMapper jsonMapper = new ObjectMapper();

    @RequestMapping(value = "/test")
    public String list(String search, Model model) {
        return "/test";
    }

    @ResponseBody
    @RequestMapping(value = "/testSign")
    public String testSign(String parameter) {
        try {
            TestVo testVo = jsonMapper.readValue(parameter, TestVo.class);
            int a=1;
        }
        catch (IOException e) {
            e.printStackTrace();
        }
        return "/test";
    }
}
